﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class range : MonoBehaviour
{
    private enemy parent;
    private void Start()
    {
        parent = GetComponentInParent<enemy>();
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            parent.MyTrgt = collision.transform;
            
            
        }
    }
    private void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            parent.MyTrgt = null;
            

        }
    }
}
